package com.study.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the opportunitys database table.
 * 
 */
@Entity
@Table(name="opportunitys")
@NamedQuery(name="Opportunity.findAll", query="SELECT o FROM Opportunity o")
public class Opportunity implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="opp_ids")
	private int oppIds;

	@Temporal(TemporalType.DATE)
	@Column(name="opp_date")
	private Date oppDate;

	@Temporal(TemporalType.DATE)
	@Column(name="opp_discover_time")
	private Date oppDiscoverTime;

	@Column(name="opp_intentional")
	private String oppIntentional;

	@Column(name="opp_money")
	private BigDecimal oppMoney;

	@Column(name="opp_name")
	private String oppName;

	@Column(name="opp_need")
	private String oppNeed;

	@Column(name="opp_possible")
	private String oppPossible;

	@Temporal(TemporalType.DATE)
	@Column(name="opp_sign_date")
	private Date oppSignDate;

	@Column(name="opp_skill")
	private byte oppSkill;

	//bi-directional many-to-one association to Competitor
	@OneToMany(mappedBy="opportunity")
	private List<Competitor> competitors;

	//bi-directional many-to-one association to Demand
	@OneToMany(mappedBy="opportunity")
	private List<Demand> demands;

	//bi-directional many-to-one association to Offer
	@OneToMany(mappedBy="opportunity")
	private List<Offer> offers;

	//bi-directional many-to-one association to Customer
	@ManyToOne
	@JoinColumn(name="cus_id")
	private Customer customer;

	//bi-directional many-to-one association to Dictionary
	@ManyToOne
	@JoinColumn(name="opp_state")
	private Dictionary dictionary1;

	//bi-directional many-to-one association to Dictionary
	@ManyToOne
	@JoinColumn(name="opp_type")
	private Dictionary dictionary2;

	//bi-directional many-to-one association to Dictionary
	@ManyToOne
	@JoinColumn(name="opp_source")
	private Dictionary dictionary3;

	//bi-directional many-to-one association to Dictionary
	@ManyToOne
	@JoinColumn(name="opp_priority")
	private Dictionary dictionary4;

	//bi-directional many-to-one association to Dictionary
	@ManyToOne
	@JoinColumn(name="opp_stage")
	private Dictionary dictionary5;
	
	//bi-directional many-to-one association to Linkman
	@ManyToOne
	@JoinColumn(name="lin_id")
	private Linkman linkman;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="user_id")
	private User user;

	//bi-directional many-to-one association to Orderform
	@OneToMany(mappedBy="opportunity")
	private List<Orderform> orderforms;

	//bi-directional many-to-one association to Solution
	@OneToMany(mappedBy="opportunity")
	private List<Solution> solutions;

	public Opportunity() {
	}

	public int getOppIds() {
		return this.oppIds;
	}

	public void setOppIds(int oppIds) {
		this.oppIds = oppIds;
	}

	public Date getOppDate() {
		return this.oppDate;
	}

	public void setOppDate(Date oppDate) {
		this.oppDate = oppDate;
	}

	public Date getOppDiscoverTime() {
		return this.oppDiscoverTime;
	}

	public void setOppDiscoverTime(Date oppDiscoverTime) {
		this.oppDiscoverTime = oppDiscoverTime;
	}

	public String getOppIntentional() {
		return this.oppIntentional;
	}

	public void setOppIntentional(String oppIntentional) {
		this.oppIntentional = oppIntentional;
	}

	public BigDecimal getOppMoney() {
		return this.oppMoney;
	}

	public void setOppMoney(BigDecimal oppMoney) {
		this.oppMoney = oppMoney;
	}

	public String getOppName() {
		return this.oppName;
	}

	public void setOppName(String oppName) {
		this.oppName = oppName;
	}

	public String getOppNeed() {
		return this.oppNeed;
	}

	public void setOppNeed(String oppNeed) {
		this.oppNeed = oppNeed;
	}

	public String getOppPossible() {
		return this.oppPossible;
	}

	public void setOppPossible(String oppPossible) {
		this.oppPossible = oppPossible;
	}

	public Date getOppSignDate() {
		return this.oppSignDate;
	}

	public void setOppSignDate(Date oppSignDate) {
		this.oppSignDate = oppSignDate;
	}

	public byte getOppSkill() {
		return this.oppSkill;
	}

	public void setOppSkill(byte oppSkill) {
		this.oppSkill = oppSkill;
	}

	public List<Competitor> getCompetitors() {
		return this.competitors;
	}

	public void setCompetitors(List<Competitor> competitors) {
		this.competitors = competitors;
	}

	public Competitor addCompetitor(Competitor competitor) {
		getCompetitors().add(competitor);
		competitor.setOpportunity(this);

		return competitor;
	}

	public Competitor removeCompetitor(Competitor competitor) {
		getCompetitors().remove(competitor);
		competitor.setOpportunity(null);

		return competitor;
	}

	public List<Demand> getDemands() {
		return this.demands;
	}

	public void setDemands(List<Demand> demands) {
		this.demands = demands;
	}

	public Demand addDemand(Demand demand) {
		getDemands().add(demand);
		demand.setOpportunity(this);

		return demand;
	}

	public Demand removeDemand(Demand demand) {
		getDemands().remove(demand);
		demand.setOpportunity(null);

		return demand;
	}

	public List<Offer> getOffers() {
		return this.offers;
	}

	public void setOffers(List<Offer> offers) {
		this.offers = offers;
	}

	public Offer addOffer(Offer offer) {
		getOffers().add(offer);
		offer.setOpportunity(this);

		return offer;
	}

	public Offer removeOffer(Offer offer) {
		getOffers().remove(offer);
		offer.setOpportunity(null);

		return offer;
	}

	public Customer getCustomer() {
		return this.customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public Dictionary getDictionary1() {
		return this.dictionary1;
	}

	public void setDictionary1(Dictionary dictionary1) {
		this.dictionary1 = dictionary1;
	}

	public Dictionary getDictionary2() {
		return this.dictionary2;
	}

	public void setDictionary2(Dictionary dictionary2) {
		this.dictionary2 = dictionary2;
	}

	public Dictionary getDictionary3() {
		return this.dictionary3;
	}

	public void setDictionary3(Dictionary dictionary3) {
		this.dictionary3 = dictionary3;
	}

	public Dictionary getDictionary4() {
		return this.dictionary4;
	}

	public void setDictionary4(Dictionary dictionary4) {
		this.dictionary4 = dictionary4;
	}

	public Dictionary getDictionary5() {
		return this.dictionary5;
	}

	public void setDictionary5(Dictionary dictionary5) {
		this.dictionary5 = dictionary5;
	}

	public Linkman getLinkman() {
		return this.linkman;
	}

	public void setLinkman(Linkman linkman) {
		this.linkman = linkman;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public List<Orderform> getOrderforms() {
		return this.orderforms;
	}

	public void setOrderforms(List<Orderform> orderforms) {
		this.orderforms = orderforms;
	}

	public Orderform addOrderform(Orderform orderform) {
		getOrderforms().add(orderform);
		orderform.setOpportunity(this);

		return orderform;
	}

	public Orderform removeOrderform(Orderform orderform) {
		getOrderforms().remove(orderform);
		orderform.setOpportunity(null);

		return orderform;
	}

	public List<Solution> getSolutions() {
		return this.solutions;
	}

	public void setSolutions(List<Solution> solutions) {
		this.solutions = solutions;
	}

	public Solution addSolution(Solution solution) {
		getSolutions().add(solution);
		solution.setOpportunity(this);

		return solution;
	}

	public Solution removeSolution(Solution solution) {
		getSolutions().remove(solution);
		solution.setOpportunity(null);

		return solution;
	}

}